/*
 *  Copyright 2004 Blandware (http://www.blandware.com)
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
package com.blandware.atleap.webapp.menu;

import java.io.Serializable;


/**
 * <p>Provides base functionality for menu components.</p>
 * <p>This class was copied from Struts Menu. 'Width' and 'height' fields replaced with 'style' and 'styleClass'</p>
 * <p><a href="MenuBase.java.html"><i>View Source</i></a></p>
 *
 * @author Scott Sayles
 * @author Matt Raible
 * @author Sergey Zubtsovskiy <a href="mailto:sergey.zubtsovskiy@blandware.com">&lt;sergey.zubtsovskiy@blandware.com&gt;</a>
 */
public abstract class MenuBase implements Serializable {
    //~ Instance fields ========================================================

    /**
     * Holds value of property action, that is, Struts Logical Action Name.
     */
    protected String action;

    /**
     * Align menu 'left','right','top','bottom' ...and other alignment of particular menu system
     */
    protected String align;

    /**
     * Holds value of property altImage.
     */
    protected String altImage;

    /**
     * Holds value of property description.
     */
    protected String description;

    /**
     * Holds value of property forward.
     */
    protected String forward;

    /**
     * Holds value of property style.
     */
    protected String style;

    /**
     * Holds value of property styleClass.
     */
    protected String styleClass;

    /**
     * Holds value of property styleId
     */
    protected String styleId;

    /**
     * Holds value of property image.
     */
    protected String image;

    /**
     * Holds value of property location.
     */
    protected String location;

    /**
     * Whether or not location is external
     */
    protected Boolean externalLocation = Boolean.FALSE;

    /**
     * Holds value of property name.
     */
    protected String name;

    /**
     * Holds value of property onclick.
     */
    protected String onclick;

    /**
     * Holds value of property onmouseout.
     */
    protected String onmouseout;

    /**
     * Holds value of property onmouseover.
     */
    protected String onmouseover;

    /**
     * Holds value of property page.
     */
    protected String anchor;

    /**
     * Holds value of property roles.
     */
    protected String roles;

    /**
     * Holds value of property target.
     */
    protected String target;

    /**
     * Holds value of property title.
     */
    protected String title;

    /**
     * Holds value of property toolTip.
     */
    protected String toolTip;

    /**
     * Holds value of hreflang property.
     */
    protected String hreflang;

    /**
     * Holds parsed (with variables) url that is used to render a link
     */
    private String url;

    //~ Constructors ===========================================================

    /**
     * Creates new MenuBase
     */
    public MenuBase() {
    }

    //~ Methods ================================================================

    /**
     * Sets the value for action.
     *
     * @param action New value of property action.
     */
    public void setAction(String action) {
        this.action = action;
    }

    /**
     * Returns the value for action.
     *
     * @return Value of property action.
     */
    public String getAction() {
        return this.action;
    }

    /**
     * Returns the value for align.
     *
     * @return Value of property align.
     */
    public String getAlign() {
        return align;
    }

    /**
     * Sets the value for align.
     *
     * @param align New value of property align.
     */
    public void setAlign(String align) {
        this.align = align;
    }

    /**
     * Setter for property altImage.
     *
     * @param altImage New value of property altImage.
     */
    public void setAltImage(String altImage) {
        this.altImage = altImage;
    }

    /**
     * Getter for property altImage.
     *
     * @return Value of property altImage.
     */
    public String getAltImage() {
        return altImage;
    }

    /**
     * Setter for property description.
     *
     * @param description New value of property description.
     */
    public void setDescription(String description) {
        this.description = description;
    }

    /**
     * Getter for property description.
     *
     * @return Value of property description.
     */
    public String getDescription() {
        return description;
    }

    /**
     * Sets the forward.
     *
     * @param forward The forward to set
     */
    public void setForward(String forward) {
        this.forward = forward;
    }

    /**
     * Gets the forward
     *
     * @return String value of property 'forward'
     */
    public String getForward() {
        return forward;
    }

    /**
     * Sets the CSS style applied to this menu
     *
     * @param style The style to set
     */
    public void setStyle(String style) {
        this.style = style;
    }

    /**
     * Gets the CSS style applied to this menu
     *
     * @return Style
     */
    public String getStyle() {
        return style;
    }

    /**
     * Sets the style class.
     *
     * @param styleClass The style class to set
     */
    public void setStyleClass(String styleClass) {
        this.styleClass = styleClass;
    }

    /**
     * Gets the style class
     *
     * @return Style class
     */
    public String getStyleClass() {
        return styleClass;
    }

    /**
     * Gets the style ID
     *
     * @return Style ID
     */
    public String getStyleId() {
        return styleId;
    }

    /**
     * Sets the style ID
     *
     * @param styleId The style ID to set
     */
    public void setStyleId(String styleId) {
        this.styleId = styleId;
    }

    /**
     * Setter for property image.
     *
     * @param image New value of property image.
     */
    public void setImage(String image) {
        this.image = image;
    }

    /**
     * Getter for property image.
     *
     * @return Value of property image.
     */
    public String getImage() {
        return image;
    }

    /**
     * Setter for property location.
     *
     * @param location New value of property location.
     */
    public void setLocation(String location) {
        this.location = location;
    }

    /**
     * Getter for property location.
     *
     * @return Value of property location.
     */
    public String getLocation() {
        return location;
    }

    /**
     * Returns <code>Boolean.TRUE</code> if location is external
     *
     * @return Whether location is external
     */
    public Boolean getExternalLocation() {
        return externalLocation;
    }

    /**
     * Sets whether location is external
     *
     * @param externalLocation Whether location is external
     */
    public void setExternalLocation(Boolean externalLocation) {
        this.externalLocation = externalLocation;
    }

    /**
     * Setter for property name.
     *
     * @param name New value of property name.
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * Getter for property name.
     *
     * @return Value of property name.
     */
    public String getName() {
        return name;
    }

    /**
     * Setter for property onclick.
     *
     * @param onclick New value of property onclick.
     */
    public void setOnclick(String onclick) {
        this.onclick = onclick;
    }

    /**
     * Getter for property onclick.
     *
     * @return Value of property onclick.
     */
    public String getOnclick() {
        return onclick;
    }

    /**
     * Setter for property onmouseout.
     *
     * @param onmouseout New value of property onmouseout.
     */
    public void setOnmouseout(String onmouseout) {
        this.onmouseout = onmouseout;
    }

    /**
     * Getter for property onmouseout.
     *
     * @return Value of property onmouseout.
     */
    public String getOnmouseout() {
        return onmouseout;
    }

    /**
     * Setter for property onmouseover.
     *
     * @param onmouseover New value of property onmouseover.
     */
    public void setOnmouseover(String onmouseover) {
        this.onmouseover = onmouseover;
    }

    /**
     * Getter for property onmouseover.
     *
     * @return Value of property onmouseover.
     */
    public String getOnmouseover() {
        return onmouseover;
    }

    /**
     * Sets the value for anchor.
     *
     * @param anchor New value of property anchor.
     */
    public void setAnchor(String anchor) {
        this.anchor = anchor;
    }

    /**
     * Returns the value for anchor.
     *
     * @return Value of property anchor.
     */
    public String getAnchor() {
        return this.anchor;
    }

    /**
     * Sets the roles.
     *
     * @param roles The roles to set
     */
    public void setRoles(String roles) {
        this.roles = roles;
    }

    /**
     * Returns the roles.
     *
     * @return String
     */
    public String getRoles() {
        return roles;
    }

    /**
     * Setter for property target.
     *
     * @param target New value of property target.
     */
    public void setTarget(String target) {
        this.target = target;
    }

    /**
     * Getter for property target.
     *
     * @return Value of property target.
     */
    public String getTarget() {
        return target;
    }

    /**
     * Setter for property title.
     *
     * @param title New value of property title.
     */
    public void setTitle(String title) {
        this.title = title;
    }

    /**
     * Getter for property title.
     *
     * @return Value of property title.
     */
    public String getTitle() {
        return title;
    }

    /**
     * Setter for property toolTip.
     *
     * @param toolTip New value of property toolTip.
     */
    public void setToolTip(String toolTip) {
        this.toolTip = toolTip;
    }

    /**
     * Getter for property toolTip.
     *
     * @return Value of property toolTip.
     */
    public String getToolTip() {
        return toolTip;
    }

    /**
     * Sets hreflang property.
     *
     * @param hreflang value to set
     */
    public void setHreflang(String hreflang) {
        this.hreflang = hreflang;
    }

    /**
     * Returns hreflang property.
     *
     * @return hreflang
     */
    public String getHreflang() {
        return hreflang;
    }

    /**
     * Sets URL
     *
     * @param url The URL to set
     */
    public void setUrl(String url) {
        this.url = url;
    }

    /**
     * Returns URL
     *
     * @return URL
     */
    public String getUrl() {
        return url;
    }
}
